/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package simulatefire.Building.Fire;

import java.util.InputMismatchException;
import java.util.Scanner;
import simulatefire.Building.Building;

/**
 *
 * @author Nicolas
 * @version $Revision: 1.0 $
 */
public class StartPoint {
    
    private int x=-1;
    private int y=-1;
    private int z=0;
    
    /**
     * Constructor for StartPoint.
     * @param building Building
     */
    StartPoint(Building building){
        
        Scanner keyboard = new Scanner(System.in);
        try{
 
            while(x<0){
                System.out.println("Entrez la position en x du départ de feu");
                x = keyboard.nextInt();
            }
            while(y<0){
                System.out.println("Entrez la position en y du départ de feu");
                y = keyboard.nextInt();
            }
            
            building.setFire(x, y, z);
            
        }catch(InputMismatchException e) {
            System.err.println("Wrong input, building creation aborted (error:" + e.getMessage() + ")");
        }
        
        /*finally{
        	keyboard.close();
        }*/
        
    }

    /**
    
     * @return the x */
    public int getX() {
        return x;
    }

    /**
    
     * @return the y */
    public int getY() {
        return y;
    }

    /**
    
     * @return the z */
    public int getZ() {
        return z;
    }
    
}
